<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>解构</title>
    <script type="application/javascript">
        //解构数组
        var [val1,val2] = ["qqq","www"];
        console.log("解构数组---------------------");
        console.log(val1);
        console.log(val2);

        //解构对象
        var {name,age} = {
            name : "lhr",
            age : 25
        }
        console.log("解构数组---------------------");
        console.log(name);
        console.log(age);

        //解构对象（嵌套）

        var articalObj = {
            author : {
                authorName : "hhhh",
                authorAge : 25
            },
            title : "ffff"
        };
        var {author,title,author:{authorName,authorAge}} = articalObj;
        console.log("解构嵌套---------------------");
        console.log(title);
        console.log(author);
        console.log(authorName);
        console.log(authorAge);
    </script>
</head>
<body>

</body>
</html>